package cn.dlc.com.controller;

import cn.dlc.com.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: dlc
 * @Date: 2022/4/26 - 13:20
 */
@RestController
public class JsdwController {

    public static String token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyYW5kIjoiNGFmYWQ2NDUtZDNlYi00Yzk5LTk2MWMtM2ZkZmRiYWM4MzY2IiwiaWF0IjoxNjYxNDc5NDY4MzQzLCJzaWQiOiIxMjAyMCJ9.oWS3_R6dmEzAlj3QcakgEmSk5vqGExGNEl3I_I2FJp0";

    @Autowired
    private IJsdwService jsdwService;

    @Autowired
    private IJldwService jldwService;

    @Autowired
    private ISgdwService sgdwService;

    @Autowired
    private IGcxxService gcxxService;

    @Autowired
    private IBJxxService ibJxxService;

    @GetMapping("jsdw")
    public String jsdw(){

        String url = "http://i.gzcc.gov.cn:6060/esb/api/12013/gck/queryjsdw";

        String params = "{ \n" +
                "    \"pagenum\": 1, \n" +
                "    \"pagesize\": 9999\n" +
                "}";

        jsdwService.set(url, params);

        return "ok";
    }

    @GetMapping("jldw")
    public String jldw(){

        String url = "http://i.gzcc.gov.cn:6060/esb/api/12013/gck/queryjldw";

        String params = "{ \n" +
                "    \"pagenum\": 1, \n" +
                "    \"pagesize\": 9999\n" +
                "}";

        jldwService.set(url, params);

        return "ok";
    }

    @GetMapping("sgdw")
    public String sgdw(){

        String url = "http://i.gzcc.gov.cn:6060/esb/api/12013/gck/querysgdw";

        String params = "{ \n" +
                "    \"pagenum\": 1, \n" +
                "    \"pagesize\": 9999\n" +
                "}";

        sgdwService.set(url, params);

        return "ok";
    }

    @GetMapping("gcxx")
    public String gcxx(){

        String url = "http://i.gzcc.gov.cn:6060/esb/api/12013/gck/querygcxx";

        String params = "{ \n" +
                "    \"pagenum\": 1, \n" +
                "    \"pagesize\": 9999\n" +
                "}";

        gcxxService.set(url, params);

        return "ok";
    }

    @GetMapping("bjxx")
    public String bjxx(){

        String url = "http://i.gzcc.gov.cn:6060/esb/api/12013/gck/querybjxx";

        String params = "{ \n" +
                "    \"pagenum\": 11, \n" +
                "    \"pagesize\": 9999\n" +
                "}";

        ibJxxService.set(url, params);

        return "ok";
    }

}
